FROM openjdk:11
MAINTAINER gzkemays
ADD /lib /app/lib
ADD yzj-data-center-service-1.0-SNAPSHOT.jar /app/yzj-data-center-service-1.0-SNAPSHOT.jar
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
ENV JVM_ARGS="-server \
-Xmx936m \
-Xms468m \
-Xmn340m \
-Xss512k \
-XX:MetaspaceSize=256m \
-XX:MaxMetaspaceSize=512m \
-XX:+UseG1GC \
-XX:CICompilerCount=3 \
-XX:ParallelGCThreads=4 \
-XX:G1ConcRefinementThreads=2 \
-XX:ConcGCThreads=2 \
-XX:MaxHeapFreeRatio=40 \
-XX:InitiatingHeapOccupancyPercent=45 \
-XX:MaxDirectMemorySize=256m \
-XX:-ShrinkHeapInSteps \
-XX:+SegmentedCodeCache \
-verbose:gc \
-XX:+PrintCommandLineFlags \
-XX:+ExplicitGCInvokesConcurrent \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=/data/yzj-data-center/dump \
-Dloader.path=/app/lib \
-Djava.rmi.server.hostname=124.221.0.90 \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.rmi.port=20001 \
-Dcom.sun.management.jmxremote.port=20001 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false"

EXPOSE 10002
ENTRYPOINT java ${JVM_ARGS} -jar -Dspring.profiles.active=prod /app/yzj-data-center-service-1.0-SNAPSHOT.jar